#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	int n = 0;
	int x = 0;
	int i = 0;
	scanf("%d %d", &n,&x);
	while (n > 0)
	{
		if (n / 2 < n - x)
		{
			n = n / 2;
		}
		else
		{
			n= n - x;
		}
		i++;
	}
	printf("%d", i);
	return 0;
}